<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set the day on which the week is deemed to start</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.set.html">IntlCalendar::set</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.setlenient.html">IntlCalendar::setLenient</a></div>
 <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="intlcalendar.setfirstdayofweek" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlCalendar::setFirstDayOfWeek</h1>
  <p class="verinfo">(PHP 5.5.0, PECL &gt;= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::setFirstDayOfWeek</span> &mdash; <span class="dc-title">Set the day on which the week is deemed to start</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-intlcalendar.setfirstdayofweek-description">
  <h3 class="title">说明</h3>
  <p class="para">
   面向对象风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>IntlCalendar::setFirstDayOfWeek</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$dayOfWeek</code></span>
   )</div>

  <p class="para rdfs-comment">
   过程化风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>intlcal_set_first_day_of_week</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.intlcalendar.html" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$cal</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$dayOfWeek</code></span>
   )</div>

  <p class="para rdfs-comment">
   Defines the day of week deemed to start the week. This affects the behavior
   of fields that depend on the concept of week start and end such as
   <strong><code>IntlCalendar::FIELD_WEEK_OF_YEAR</code></strong> and
   <strong><code>IntlCalendar::FIELD_YEAR_WOY</code></strong>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-intlcalendar.setfirstdayofweek-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">cal</code></em></dt>

    <dd>

     <p class="para">
      The IntlCalendar resource.
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">dayOfWeek</code></em></dt>

    <dd>

     <p class="para">
      One of the constants <strong><code>IntlCalendar::DOW_SUNDAY</code></strong>,
      <strong><code>IntlCalendar::DOW_MONDAY</code></strong>, …,
      <strong><code>IntlCalendar::DOW_SATURDAY</code></strong>.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-intlcalendar.setfirstdayofweek-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success. Failure can only happen due to invalid parameters.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-intlcalendar.setfirstdayofweek-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2556">
   <p><strong>Example #1 <span class="function"><strong>IntlCalendar::setFirstDayOfWeek()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'date.timezone'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'Europe/Lisbon'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'intl.default_locale'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'es_ES'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$cal&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">createInstance</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #0000BB">2013</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">5&nbsp;</span><span style="color: #FF8000">/*&nbsp;June&nbsp;*/</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">30</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;A&nbsp;Sunday<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFirstDayOfWeek</span><span style="color: #007700">());&nbsp;</span><span style="color: #FF8000">//&nbsp;2&nbsp;(Monday)<br /><br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">formatObject</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">,&nbsp;&lt;&lt;&lt;EOD<br /></span><span style="color: #DD0000">'local&nbsp;day&nbsp;of&nbsp;week:&nbsp;'cc'<br />week&nbsp;of&nbsp;month&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;'W'<br />week&nbsp;of&nbsp;year&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;'ww<br /></span><span style="color: #007700">EOD<br />),&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setFirstDayOfWeek</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">DOW_SUNDAY</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">formatObject</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">,&nbsp;&lt;&lt;&lt;EOD<br /></span><span style="color: #DD0000">'local&nbsp;day&nbsp;of&nbsp;week:&nbsp;'cc'<br />week&nbsp;of&nbsp;month&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;'W'<br />week&nbsp;of&nbsp;year&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;'ww<br /></span><span style="color: #007700">EOD<br />),&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
int(2)
local day of week: 7
week of month    : 4
week of year     : 26
local day of week: 1
week of month    : 5
week of year     : 27
</pre></div>
    </div>
   </div>
  </p>
 </div>



</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.set.html">IntlCalendar::set</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.setlenient.html">IntlCalendar::setLenient</a></div>
 <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
